#include <iostream>

#include "User.h"
#include "GL/glut.h"

User user;

void render() {
    user.render();
}

//based on code from http://www.lighthouse3d.com/opengl/glsl/index.php?minimal
void reshape(int w, int h) {
    user.reshape(w, h);
}

void keyboard(unsigned char key, int x, int y) {
    user.keyboard(key, x, y);
}

void mouseState(int button, int state, int x, int y) {
    user.mouseState(button, state, x, y);
}

void mouseMotion(int x, int y) {
    user.mouseMotion(x, y);
}

int main(int argc, char* argv[]) {
    user.init(argc, argv);

    glutDisplayFunc(render);
	glutIdleFunc(render);
	glutReshapeFunc(reshape);
    glutKeyboardFunc(keyboard);
    glutMouseFunc(mouseState);
    glutMotionFunc(mouseMotion);

    glutMainLoop();
    return 0;
}
